Index-sensitive String Analysis Based on Monadic Second-order Logic
نویسندگان
چکیده
We propose a novel technique for statically verifying the strings generated by a program. The verification is conducted by encoding the program inMonadic Second-Order Logic (M2L). We use M2L to describe constraints among program variables and to abstract built-in string operations. Once we encode a program in M2L, a theorem prover for M2L, such as MONA, can automatically check if a string generated by the program satisfies a given specification, and if not, exhibit a counterexample. With this approach, we can naturally encode relationships among strings, accounting also for cases in which a program manipulates strings using indices. In addition, our string analysis is path sensitive in that it accounts for the effects of string and Boolean comparisons, as well as regular-expression matches. We have implemented our string-analysis algorithm, and used it to augment an industrial security analysis for Web applications by automatically detecting and verifying sanitizers—methods that eliminate malicious patterns from untrusted strings, making those strings safe to use in security-sensitive operations. On the 8 benchmarks we analyzed, our string analyzer discovered 128 previously unknown sanitizers, compared to 71 sanitizers detected by a previously presented string analysis.
منابع مشابه
On regular languages over power sets
The power set of a finite set is used as the alphabet of a string interpreting a sentence of Monadic Second-Order Logic so that the string can be reduced (in straightforward ways) to the symbols occurring in the sentence. Simple extensions to regular expressions are described matching the succinctness of Monadic Second-Order Logic. A link to Goguen and Burstall's notion of an institution is for...
متن کاملModel-based Automatic Synthesis and Analysis in Second-Order Monadic Logic
This paper shows how monadic second-order logic on strings M2L(Str) can pro tably be used as a description language for model-based analysis of software as well as hardware systems. It is therefore a good candidate formalism for hardware/software codesign. This logic conveniently combines two important features in a single formalism: It is both an abstract speci cation language and an e ective ...
متن کاملFirst-order Definable String Transformations
The connection between languages defined by computational models and logic for languages is well-studied. Monadic second-order logic and finite automata are shown to closely correspond to each-other for the languages of strings, trees, and partial-orders. Similar connections are shown for first-order logic and finite automata with certain aperiodicity restriction. Courcelle in 1994 proposed a w...
متن کاملFO-Definable Transformations of Infinite Strings
The theory of regular and aperiodic transformations of finite strings has recently received a lot of interest. These classes can be equivalently defined using logic (Monadic second-order logic and first-order logic), two-way machines (regular two-way and aperiodic two-way transducers), and one-way register machines (regular streaming string and aperiodic streaming string transducers). These cla...
متن کاملExpressing Cardinality Quantifiers in Monadic Second-Order Logic over Trees
We study an extension of monadic second-order logic of order with the uncountability quantifier “there exist uncountably many sets”. We prove that, over the class of finitely branching trees, this extension is equally expressive to plain monadic second-order logic of order. Additionally we find that the continuum hypothesis holds for classes of sets definable in monadic second-order logic over ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2012